﻿using System;
using System.Windows.Forms;

namespace FileSynchronizer.Forms
{
    public partial class Form_Error : Form
    {
        #region Constructors
        //---------------------------------------------------------------------------------------------------------------------------------------

        public Form_Error()
        {
            InitializeComponent();
        }

        //---------------------------------------------------------------------------------------------------------------------------------------       
        #endregion

        #region Public Methods
        //---------------------------------------------------------------------------------------------------------------------------------------
        // Add a message to the listbox
        //---------------------------------------------------------------------------------------------------------------------------------------
        public void AddErrorString(string TheErrorString)
        {
            listBox1.Items.Add(TheErrorString);
            if (!Visible)
            {
                Show();
            }
        }
        //---------------------------------------------------------------------------------------------------------------------------------------       
        #endregion

        #region Event Handlers
        //---------------------------------------------------------------------------------------------------------------------------------------
        // Called when the User clicks the "OK" button
        //---------------------------------------------------------------------------------------------------------------------------------------
        private void OnHide(object sender, EventArgs e)
        {
            Hide();
        }
        //---------------------------------------------------------------------------------------------------------------------------------------       
        #endregion
    }
}
